package org.aeon.gamechatnest.pojo;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.aeon.gamechatnest.validated.Add;
import org.aeon.gamechatnest.validated.Update;
import org.springframework.data.annotation.Id;

import java.io.Serial;
import java.io.Serializable;

/**
 * 文字频道表
 *
 * @author : Liys 2024年5月10日
 * @TableName text_channel
 */
@Data
@Schema(description = "文字频道表实体", name = "TextChannel")
@AllArgsConstructor
@NoArgsConstructor
@TableName("text_channel")
public class TextChannel implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    /**
     * 文字频道id
     */
    @Schema(description = "文字频道id", name = "tcId")
    @TableId
    @Null(groups = Add.class, message = "新增时文字频道id应该为空")
    @NotNull(groups = Update.class, message = "更新时文字频道id不能为空")
    private Long tcId;
    /**
     * 服务器id
     */
    @Schema(description = "服务器id", name = "serverId")
    @NotNull(groups = Add.class, message = "新增时服务器id不应该为空")
    @Null(groups = Update.class, message = "更新时服务器id应该为空")
    private Long serverId;
    /**
     * 频道名称
     */
    @Schema(description = "频道名称", name = "name")
    @NotBlank(groups = {Add.class}, message = "文字频道名称不能为空")
    private String name;
    /**
     * 频道简介
     */
    @Schema(description = "频道简介", name = "introduce")
    private String introduce;
}
